﻿IF EXISTS (SELECT * from sys.procedures p left join sys.schemas s on p.schema_id = s.schema_id where p.name='geolocalisation_update' and s.name='Meta')
DROP PROCEDURE [Meta].geolocalisation_update
GO
CREATE PROCEDURE [Meta].geolocalisation_update 
@PK uniqueidentifier, 
@Latitude float,
@Longitude float,
@DisplayName nvarchar(50),
@ItemType varchar(30)
AS
BEGIN
UPDATE [Meta].[Geolocalisation] 
SET	[point] = geography::Point(@Latitude, @Longitude, 4326),
	[display_name] = @DisplayName,
	[item_type] = @ItemType
WHERE
	[id_reference] = @PK 
END